package itBean;
import java.util.Scanner;
public class Book {
    private String title;
    private int page;

    public Book() {
        this.page = 200;
    }

    public Book(String title, int page) {
        this.title = title;
        if (page >= 200) {
            this.page = page;
        } else {
            System.out.println("教材页数输出错误");
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        if (page >= 200) {
            this.page = page;
        } else {
            System.out.println("输出错误");
        }
    }

    Scanner sc = new Scanner(System.in);

    public void detail() {
        System.out.println("教材的名字：" + this.title);
        if (this.page >= 200) {
            System.out.println("教材的名字：" + this.page);
        } else {
            System.out.println("教材页输出错误");
        }
    }
}
